<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>String operations &mdash; NumPy v1.18 Manual</title>
    
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" >
    <link rel="stylesheet" href="../_static/graphviz.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.18.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script type="text/javascript" src="../_static/js/copybutton.js"></script>
    <link rel="author" title="About these documents" href="../about.html" >
    <link rel="index" title="Index" href="../genindex.html" >
    <link rel="search" title="Search" href="../search.html" >
    <link rel="top" title="NumPy v1.18 Manual" href="../index.html" >
    <link rel="up" title="Routines" href="routines.html" >
    <link rel="next" title="numpy.char.add" href="generated/numpy.char.add.html" >
    <link rel="prev" title="numpy.binary_repr" href="generated/numpy.binary_repr.html" > 
  </head>
  <body>
<div class="container">
  <div class="top-scipy-org-logo-header" style="background-color: #a2bae8;">
    <a href="../index.html">
      <img border=0 alt="NumPy" src="../_static/numpy_logo.png"></a>
    </div>
  </div>
</div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
        <li class="active"><a href="https://numpy.org/">NumPy.org</a></li>
        <li class="active"><a href="https://numpy.org/doc">Docs</a></li>
        
        <li class="active"><a href="../index.html">NumPy v1.18 Manual</a></li>
        

          <li class="active"><a href="index.html" >NumPy Reference</a></li>
          <li class="active"><a href="routines.html" accesskey="U">Routines</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="generated/numpy.char.add.html" title="numpy.char.add"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="generated/numpy.binary_repr.html" title="numpy.binary_repr"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">String operations</a><ul>
<li><a class="reference internal" href="#id1">String operations</a></li>
<li><a class="reference internal" href="#comparison">Comparison</a></li>
<li><a class="reference internal" href="#string-information">String information</a></li>
<li><a class="reference internal" href="#convenience-class">Convenience class</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="generated/numpy.binary_repr.html"
                        title="previous chapter">numpy.binary_repr</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="generated/numpy.char.add.html"
                        title="next chapter">numpy.char.add</a></p>
<div id="searchbox" style="display: none" role="search">
  <h4>Quick search</h4>
    <div>
    <form class="search" action="../search.html" method="get">
      <input type="text" style="width: inherit;" name="q" />
      <input type="submit" value="search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="module-numpy.char">
<span id="string-operations"></span><h1>String operations<a class="headerlink" href="#module-numpy.char" title="Permalink to this headline">¶</a></h1>
<p>The <a class="reference internal" href="#module-numpy.char" title="numpy.char"><code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.char</span></code></a> module provides a set of vectorized string
operations for arrays of type <code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.string_</span></code> or <code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.unicode_</span></code>.
All of them are based on the string methods in the Python standard library.</p>
<div class="section" id="id1">
<h2>String operations<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.add.html#numpy.char.add" title="numpy.char.add"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add</span></code></a>(x1, x2)</p></td>
<td><p>Return element-wise string concatenation for two arrays of str or unicode.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.multiply.html#numpy.char.multiply" title="numpy.char.multiply"><code class="xref py py-obj docutils literal notranslate"><span class="pre">multiply</span></code></a>(a, i)</p></td>
<td><p>Return (a * i), that is string multiple concatenation, element-wise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.mod.html#numpy.char.mod" title="numpy.char.mod"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mod</span></code></a>(a, values)</p></td>
<td><p>Return (a % i), that is pre-Python 2.6 string formatting (iterpolation), element-wise for a pair of array_likes of str or unicode.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.capitalize.html#numpy.char.capitalize" title="numpy.char.capitalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">capitalize</span></code></a>(a)</p></td>
<td><p>Return a copy of <em class="xref py py-obj">a</em> with only the first character of each element capitalized.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.center.html#numpy.char.center" title="numpy.char.center"><code class="xref py py-obj docutils literal notranslate"><span class="pre">center</span></code></a>(a, width[, fillchar])</p></td>
<td><p>Return a copy of <em class="xref py py-obj">a</em> with its elements centered in a string of length <em class="xref py py-obj">width</em>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.decode.html#numpy.char.decode" title="numpy.char.decode"><code class="xref py py-obj docutils literal notranslate"><span class="pre">decode</span></code></a>(a[, encoding, errors])</p></td>
<td><p>Calls <em class="xref py py-obj">str.decode</em> element-wise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.encode.html#numpy.char.encode" title="numpy.char.encode"><code class="xref py py-obj docutils literal notranslate"><span class="pre">encode</span></code></a>(a[, encoding, errors])</p></td>
<td><p>Calls <em class="xref py py-obj">str.encode</em> element-wise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.expandtabs.html#numpy.char.expandtabs" title="numpy.char.expandtabs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expandtabs</span></code></a>(a[, tabsize])</p></td>
<td><p>Return a copy of each string element where all tab characters are replaced by one or more spaces.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.join.html#numpy.char.join" title="numpy.char.join"><code class="xref py py-obj docutils literal notranslate"><span class="pre">join</span></code></a>(sep, seq)</p></td>
<td><p>Return a string which is the concatenation of the strings in the sequence <em class="xref py py-obj">seq</em>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.ljust.html#numpy.char.ljust" title="numpy.char.ljust"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ljust</span></code></a>(a, width[, fillchar])</p></td>
<td><p>Return an array with the elements of <em class="xref py py-obj">a</em> left-justified in a string of length <em class="xref py py-obj">width</em>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.lower.html#numpy.char.lower" title="numpy.char.lower"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lower</span></code></a>(a)</p></td>
<td><p>Return an array with the elements converted to lowercase.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.lstrip.html#numpy.char.lstrip" title="numpy.char.lstrip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lstrip</span></code></a>(a[, chars])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a copy with the leading characters removed.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.partition.html#numpy.char.partition" title="numpy.char.partition"><code class="xref py py-obj docutils literal notranslate"><span class="pre">partition</span></code></a>(a, sep)</p></td>
<td><p>Partition each element in <em class="xref py py-obj">a</em> around <em class="xref py py-obj">sep</em>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.replace.html#numpy.char.replace" title="numpy.char.replace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">replace</span></code></a>(a, old, new[, count])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a copy of the string with all occurrences of substring <em class="xref py py-obj">old</em> replaced by <em class="xref py py-obj">new</em>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.rjust.html#numpy.char.rjust" title="numpy.char.rjust"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rjust</span></code></a>(a, width[, fillchar])</p></td>
<td><p>Return an array with the elements of <em class="xref py py-obj">a</em> right-justified in a string of length <em class="xref py py-obj">width</em>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.rpartition.html#numpy.char.rpartition" title="numpy.char.rpartition"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rpartition</span></code></a>(a, sep)</p></td>
<td><p>Partition (split) each element around the right-most separator.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.rsplit.html#numpy.char.rsplit" title="numpy.char.rsplit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rsplit</span></code></a>(a[, sep, maxsplit])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a list of the words in the string, using <em class="xref py py-obj">sep</em> as the delimiter string.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.rstrip.html#numpy.char.rstrip" title="numpy.char.rstrip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rstrip</span></code></a>(a[, chars])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a copy with the trailing characters removed.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.split.html#numpy.char.split" title="numpy.char.split"><code class="xref py py-obj docutils literal notranslate"><span class="pre">split</span></code></a>(a[, sep, maxsplit])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a list of the words in the string, using <em class="xref py py-obj">sep</em> as the delimiter string.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.splitlines.html#numpy.char.splitlines" title="numpy.char.splitlines"><code class="xref py py-obj docutils literal notranslate"><span class="pre">splitlines</span></code></a>(a[, keepends])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a list of the lines in the element, breaking at line boundaries.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.strip.html#numpy.char.strip" title="numpy.char.strip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">strip</span></code></a>(a[, chars])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a copy with the leading and trailing characters removed.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.swapcase.html#numpy.char.swapcase" title="numpy.char.swapcase"><code class="xref py py-obj docutils literal notranslate"><span class="pre">swapcase</span></code></a>(a)</p></td>
<td><p>Return element-wise a copy of the string with uppercase characters converted to lowercase and vice versa.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.title.html#numpy.char.title" title="numpy.char.title"><code class="xref py py-obj docutils literal notranslate"><span class="pre">title</span></code></a>(a)</p></td>
<td><p>Return element-wise title cased version of string or unicode.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.translate.html#numpy.char.translate" title="numpy.char.translate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">translate</span></code></a>(a, table[, deletechars])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return a copy of the string where all characters occurring in the optional argument <em class="xref py py-obj">deletechars</em> are removed, and the remaining characters have been mapped through the given translation table.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.upper.html#numpy.char.upper" title="numpy.char.upper"><code class="xref py py-obj docutils literal notranslate"><span class="pre">upper</span></code></a>(a)</p></td>
<td><p>Return an array with the elements converted to uppercase.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.zfill.html#numpy.char.zfill" title="numpy.char.zfill"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zfill</span></code></a>(a, width)</p></td>
<td><p>Return the numeric string left-filled with zeros</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="comparison">
<h2>Comparison<a class="headerlink" href="#comparison" title="Permalink to this headline">¶</a></h2>
<p>Unlike the standard numpy comparison operators, the ones in the <em class="xref py py-obj">char</em>
module strip trailing whitespace characters before performing the
comparison.</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.equal.html#numpy.char.equal" title="numpy.char.equal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">equal</span></code></a>(x1, x2)</p></td>
<td><p>Return (x1 == x2) element-wise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.not_equal.html#numpy.char.not_equal" title="numpy.char.not_equal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">not_equal</span></code></a>(x1, x2)</p></td>
<td><p>Return (x1 != x2) element-wise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.greater_equal.html#numpy.char.greater_equal" title="numpy.char.greater_equal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">greater_equal</span></code></a>(x1, x2)</p></td>
<td><p>Return (x1 &gt;= x2) element-wise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.less_equal.html#numpy.char.less_equal" title="numpy.char.less_equal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">less_equal</span></code></a>(x1, x2)</p></td>
<td><p>Return (x1 &lt;= x2) element-wise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.greater.html#numpy.char.greater" title="numpy.char.greater"><code class="xref py py-obj docutils literal notranslate"><span class="pre">greater</span></code></a>(x1, x2)</p></td>
<td><p>Return (x1 &gt; x2) element-wise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.less.html#numpy.char.less" title="numpy.char.less"><code class="xref py py-obj docutils literal notranslate"><span class="pre">less</span></code></a>(x1, x2)</p></td>
<td><p>Return (x1 &lt; x2) element-wise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.compare_chararrays.html#numpy.char.compare_chararrays" title="numpy.char.compare_chararrays"><code class="xref py py-obj docutils literal notranslate"><span class="pre">compare_chararrays</span></code></a>(a, b, cmp_op, rstrip)</p></td>
<td><p>Performs element-wise comparison of two string arrays using the comparison operator specified by <em class="xref py py-obj">cmp_op</em>.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="string-information">
<h2>String information<a class="headerlink" href="#string-information" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.count.html#numpy.char.count" title="numpy.char.count"><code class="xref py py-obj docutils literal notranslate"><span class="pre">count</span></code></a>(a, sub[, start, end])</p></td>
<td><p>Returns an array with the number of non-overlapping occurrences of substring <em class="xref py py-obj">sub</em> in the range [<em class="xref py py-obj">start</em>, <em class="xref py py-obj">end</em>].</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.endswith.html#numpy.char.endswith" title="numpy.char.endswith"><code class="xref py py-obj docutils literal notranslate"><span class="pre">endswith</span></code></a>(a, suffix[, start, end])</p></td>
<td><p>Returns a boolean array which is <em class="xref py py-obj">True</em> where the string element in <em class="xref py py-obj">a</em> ends with <em class="xref py py-obj">suffix</em>, otherwise <em class="xref py py-obj">False</em>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.find.html#numpy.char.find" title="numpy.char.find"><code class="xref py py-obj docutils literal notranslate"><span class="pre">find</span></code></a>(a, sub[, start, end])</p></td>
<td><p>For each element, return the lowest index in the string where substring <em class="xref py py-obj">sub</em> is found.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.index.html#numpy.char.index" title="numpy.char.index"><code class="xref py py-obj docutils literal notranslate"><span class="pre">index</span></code></a>(a, sub[, start, end])</p></td>
<td><p>Like <a class="reference internal" href="generated/numpy.char.find.html#numpy.char.find" title="numpy.char.find"><code class="xref py py-obj docutils literal notranslate"><span class="pre">find</span></code></a>, but raises <em class="xref py py-obj">ValueError</em> when the substring is not found.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.isalpha.html#numpy.char.isalpha" title="numpy.char.isalpha"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isalpha</span></code></a>(a)</p></td>
<td><p>Returns true for each element if all characters in the string are alphabetic and there is at least one character, false otherwise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.isalnum.html#numpy.char.isalnum" title="numpy.char.isalnum"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isalnum</span></code></a>(a)</p></td>
<td><p>Returns true for each element if all characters in the string are alphanumeric and there is at least one character, false otherwise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.isdecimal.html#numpy.char.isdecimal" title="numpy.char.isdecimal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isdecimal</span></code></a>(a)</p></td>
<td><p>For each element, return True if there are only decimal characters in the element.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.isdigit.html#numpy.char.isdigit" title="numpy.char.isdigit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isdigit</span></code></a>(a)</p></td>
<td><p>Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.islower.html#numpy.char.islower" title="numpy.char.islower"><code class="xref py py-obj docutils literal notranslate"><span class="pre">islower</span></code></a>(a)</p></td>
<td><p>Returns true for each element if all cased characters in the string are lowercase and there is at least one cased character, false otherwise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.isnumeric.html#numpy.char.isnumeric" title="numpy.char.isnumeric"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isnumeric</span></code></a>(a)</p></td>
<td><p>For each element, return True if there are only numeric characters in the element.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.isspace.html#numpy.char.isspace" title="numpy.char.isspace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isspace</span></code></a>(a)</p></td>
<td><p>Returns true for each element if there are only whitespace characters in the string and there is at least one character, false otherwise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.istitle.html#numpy.char.istitle" title="numpy.char.istitle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">istitle</span></code></a>(a)</p></td>
<td><p>Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.isupper.html#numpy.char.isupper" title="numpy.char.isupper"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isupper</span></code></a>(a)</p></td>
<td><p>Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.rfind.html#numpy.char.rfind" title="numpy.char.rfind"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rfind</span></code></a>(a, sub[, start, end])</p></td>
<td><p>For each element in <em class="xref py py-obj">a</em>, return the highest index in the string where substring <em class="xref py py-obj">sub</em> is found, such that <em class="xref py py-obj">sub</em> is contained within [<em class="xref py py-obj">start</em>, <em class="xref py py-obj">end</em>].</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.rindex.html#numpy.char.rindex" title="numpy.char.rindex"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rindex</span></code></a>(a, sub[, start, end])</p></td>
<td><p>Like <a class="reference internal" href="generated/numpy.char.rfind.html#numpy.char.rfind" title="numpy.char.rfind"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rfind</span></code></a>, but raises <em class="xref py py-obj">ValueError</em> when the substring <em class="xref py py-obj">sub</em> is not found.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.startswith.html#numpy.char.startswith" title="numpy.char.startswith"><code class="xref py py-obj docutils literal notranslate"><span class="pre">startswith</span></code></a>(a, prefix[, start, end])</p></td>
<td><p>Returns a boolean array which is <em class="xref py py-obj">True</em> where the string element in <em class="xref py py-obj">a</em> starts with <em class="xref py py-obj">prefix</em>, otherwise <em class="xref py py-obj">False</em>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.str_len.html#numpy.char.str_len" title="numpy.char.str_len"><code class="xref py py-obj docutils literal notranslate"><span class="pre">str_len</span></code></a>(a)</p></td>
<td><p>Return len(a) element-wise.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="convenience-class">
<h2>Convenience class<a class="headerlink" href="#convenience-class" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.array.html#numpy.char.array" title="numpy.char.array"><code class="xref py py-obj docutils literal notranslate"><span class="pre">array</span></code></a>(obj[, itemsize, copy, unicode, order])</p></td>
<td><p>Create a <a class="reference internal" href="generated/numpy.char.chararray.html#numpy.char.chararray" title="numpy.char.chararray"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chararray</span></code></a>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.char.asarray.html#numpy.char.asarray" title="numpy.char.asarray"><code class="xref py py-obj docutils literal notranslate"><span class="pre">asarray</span></code></a>(obj[, itemsize, unicode, order])</p></td>
<td><p>Convert the input to a <a class="reference internal" href="generated/numpy.char.chararray.html#numpy.char.chararray" title="numpy.char.chararray"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chararray</span></code></a>, copying the data only if necessary.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.char.chararray.html#numpy.char.chararray" title="numpy.char.chararray"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chararray</span></code></a>(shape[, itemsize, unicode, …])</p></td>
<td><p>Provides a convenient view on arrays of string and unicode values.</p></td>
</tr>
</tbody>
</table>
</div>
</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2019, The SciPy community.
      </li>
      <li>
      Last updated on Feb 20, 2020.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.4.2.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>